import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/Home.vue'
import Sport from '../views/Sport/Sport.vue'
import Mine from '../views/Mine/Mine.vue'
import User from '../views/Mine/User.vue'
import CourseDetails from '../views/Home/CourseDetails'
import MyCourse from '../views/Sport/MyCourse.vue'
import TeamCourse from '../views/Sport/TeamCourse'
import CourseCard from '../views/Mine/CourseCard.vue'
import MyOrder from '../views/Mine/MyOrder.vue'
import RedeemVipcard from '../views/Mine/RedeemVipcard.vue'
import CoachDetails from '@/views/Home/CoachDetails'
import CampDetails from '@/views/Home/CampDetails'
import StudentDetails from '@/views/Home/StudentDetails'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: {
      title: '首页',
      keepAlive: true,
      scrollTop: 0,
      showTab: true
    }
  },
  {
    path: '/sport',
    name: 'Sport',
    component: Sport,
    meta: {
      title: '运动',
      keepAlive: false,
      showTab: true
    }
  },
  {
    path: '/user',
    name: 'USer',
    component: User,
    meta: {
      title: '登录注册',
      keepAlive: false,
      showTab: false
    }
  },
  {
    path: '/mine',
    name: 'Mine',
    meta: {
      title: '我的',
      keepAlive: false,
      showTab: true
    },
    component: Mine
  },
  {
    path: '/coursedetails',
    name: 'CourseDetails',
    meta: {
      title: '课程详情',
      keepAlive: false,
      showTab: false
    },
    component: CourseDetails
  },
  {
    path: '/mycourse',
    name: 'MyCourse',
    component: MyCourse,
    meta: {
      keepAlive: false,
      showTab: false
    }
  },
  {
    path: '/teamcourse',
    name: 'TeamCourse',
    component: TeamCourse,
    // 隐藏导航栏-cici
    meta: {
      keepAlive: false,
      showTab: false
    }
  },
  {
    path: '/coursecard',
    name: 'CourseCard',
    component: CourseCard,
    meta: {
      keepAlive: false,
      showTab: false
    }
  },
  {
    path: '/myorder',
    name: 'MyOrder',
    component: MyOrder,
    meta: {
      keepAlive: false,
      showTab: false
    }
  },
  {
    path: '/redeemvipcard',
    name: 'RedeemVipcard',
    component: RedeemVipcard,
    meta: {
      keepAlive: false,
      showTab: false
    }
  },
  {
    path: '/coachdetails',
    name: 'coachdetails',
    component: CoachDetails,
    meta: {
      title: '私人教练',
      keepAlive: false,
      showTab: false
    }
  },
  {
    path: '/campdetails',
    name: 'campdetails',
    component: CampDetails,
    meta: {
      title: '训练营',
      keepAlive: false,
      showTab: false
    }
  },
  {
    path: '/studentdetails',
    name: 'studentdetails',
    component: StudentDetails,
    meta: {
      title: '学员案例',
      keepAlive: false,
      showTab: false
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
